import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import('@/views/layout/'),
    children: [
      {
        path: '',
        name: 'home',
        component: () => import('@/views/home/')
      },
      {
        path: '/ranking',
        name: 'ranking',
        component: () => import('@/views/ranking/')
      },
      {
        path: '/album',
        name: 'album',
        component: () => import('@/views/album/')
      },
      {
        path: '/my',
        name: 'my',
        component: () => import('@/views/my/')
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/')
  },
  {
    path: '/songList/:songListId',
    name: 'songList',
    component: () => import('@/components/songComponent/song-list'),
    props: true
  },
  {
    path: '/recentlyPlayed',
    name: 'recentlyPlayed',
    component: () => import('@/views/recentlyPlayed/')
  },
  {
    path: '/DjSongList/:songListId',
    name: 'DjSongList',
    component: () => import('@/components/DjComponent/DjSongList'),
    props: true
  },
  {
    path: '/search',
    name: 'search',
    component: () => import('@/views/search/')
  }
]

const router = new VueRouter({
  routes
})

export default router
